/**
 * \class CTorus
 * \brief This is a 2-d torus like doughnut
 * \breif The structure is like the below:
 * \brief (0,0) (0,1) ~ (0,j)
 * \brief (1,0) (1,1) ~ (1,j)
 * \brief ~
 * \brief (i,0) (i,1) ~ (i,j).
 * 
 * \version 0.3.2
 *
 * \author Woo-Hyun Kim (woorung@nhncorp.com, woorung@gmail.com)
 * \author http://blog.naver.com/wisereign .
 *
 * \date 2008/6/18
 */
// =============================================================
#ifndef CTorusH
#define CTorusH
//-----------------------------------------------------------------
#include <iostream>
#include <iterator>
#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include <fstream>
#include <string>

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>

using namespace std;

//---------------------------------------------------------------
/*
class CTorusNode {
private :
	pair<int,int> coordinates;
	string url;
	string port;
	
public :
	CTorusNode();
	CTorusNode(pair<int,int> coords) {
		coordinates.first = coords.first;
		coordinates.second = coords.second;
	};
	~CTorusNode();

	string &getAccessPoint(string &ref) {
		ref = url + ":" + port;
		return ref;
	};
};
*/
//---------------------------------------------------------------
class CTorus {
private :
	long rows;
	long columns;

//protected :
public :
	virtual pair<long,long> &up(pair<long,long> &pos);
	virtual pair<long,long> &down(pair<long,long> &pos);
	virtual pair<long,long> &right(pair<long,long> &pos);
	virtual pair<long,long> &left(pair<long,long> &pos);
	
public :
	CTorus(long rows, long columns);
	virtual ~CTorus();
};
//----------------------------------------------------------------
#endif
